<?php
class Maven_ManageCatalogSpr_Model_ProductImport extends Varien_Object
{

	public $store;
	public $_stores;
	public $_storesIdCode;
	public $websiteIds;
	public $entityTypeId;
	/**
	 * @var database connections
	 */
	public $con;
	public $installer;
	public $disable_layer_nav = array('Product Name', 'Compatible Technology', 'Features', 'Digital Tuner','Input Voltage',
		'Number of Channels', 'Screen Technology', 'Packaged Quantity','Features','Recycled',
		'Sealing Process','Staple Type','Throat Width', 'Fragrance Classification','Accessibility');

	public function __construct()
	{
		$this->_initStores();
		$this->entityTypeId = Mage::getModel('catalog/product')->getResource()->getTypeId();
		$this->store = $this->getStoreByCode('admin');
		$this->websiteIds = array(1);
		$this->con = Mage::getSingleton('core/resource')->getConnection('core_write');		$this->installer = new Mage_Catalog_Model_Resource_Eav_Mysql4_Setup('core_setup');
	}
	public function getEntityTypeId()
	{
		return $this->entityTypeId;
	}
	
/**
	 *  Init stores
	 *
	 *  @param    none
	 *  @return      void
	 */
	protected function _initStores ()
	{
		if (is_null($this->_stores)) {
			$this->_stores = Mage::app()->getStores(true, true);
			foreach ($this->_stores as $code => $store) {
				$this->_storesIdCode[$store->getId()] = $code;
			}
		}
	}

	/**
	 * Retrieve store object by code
	 *
	 * @param string $store
	 * @return Mage_Core_Model_Store
	 */
	public function getStoreByCode($store)
	{
		$this->_initStores();
		if (isset($this->_stores[$store])) {
			return $this->_stores[$store];
		}
		return false;
	}
	/**
	 * @param unknown_type $field
	 * @return Config value for the price file import.
	 */
	public function getConfigVal($field)
	{
		return Mage::getStoreConfig('managecatalogspr/price_file/'.$field);
	}


	/**
	 * @return Spexlive App Id
	 */
	public function getAppId()
	{
		return $this->getConfigVal('spex_app_id');
	}
}